Optimal. Leaf size=27 \[ -\frac {x}{2 a}-\frac {\cos (x)}{a}+\frac {\cos (x) \sin (x)}{2 a} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {3957, 2918,
2718, 2715, 8} \begin {gather*} -\frac {x}{2 a}-\frac {\cos (x)}{a}+\frac {\sin (x) \cos (x)}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2715
Rule 2718
Rule 2918
Rule 3957
Rubi steps
\begin {align*} \int \frac {\cos ^2(x)}{a+a \csc (x)} \, dx &=\int \frac {\cos ^2(x) \sin (x)}{a+a \sin (x)} \, dx\\ &=\frac {\int \sin (x) \, dx}{a}-\frac {\int \sin ^2(x) \, dx}{a}\\ &=-\frac {\cos (x)}{a}+\frac {\cos (x) \sin (x)}{2 a}-\frac {\int 1 \, dx}{2 a}\\ &=-\frac {x}{2 a}-\frac {\cos (x)}{a}+\frac {\cos (x) \sin (x)}{2 a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.03, size = 27, normalized size = 1.00 \begin {gather*} -\frac {x}{2 a}-\frac {\cos (x)}{a}+\frac {\sin (2 x)}{4 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(48\) vs.
\(2(23)=46\).
time = 0.07, size = 49, normalized size = 1.81
method | result | size |
risch | \(-\frac {x}{2 a}-\frac {\cos \left (x \right )}{a}+\frac {\sin \left (2 x \right )}{4 a}\) | \(24\) |
default | \(\frac {\frac {4 \left (-\frac {\left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{4}-\frac {\left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2}+\frac {\tan \left (\frac {x}{2}\right )}{4}-\frac {1}{2}\right )}{\left (\tan ^{2}\left (\frac {x}{2}\right )+1\right )^{2}}-\arctan \left (\tan \left (\frac {x}{2}\right )\right )}{a}\) | \(49\) |
norman | \(\frac {-\frac {2}{a}-\frac {\tan \left (\frac {x}{2}\right )}{a}-\frac {\tan ^{4}\left (\frac {x}{2}\right )}{a}-\frac {3 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{a}-\frac {\tan ^{2}\left (\frac {x}{2}\right )}{a}-\frac {x}{2 a}-\frac {x \tan \left (\frac {x}{2}\right )}{2 a}-\frac {x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{a}-\frac {x \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{a}-\frac {x \left (\tan ^{4}\left (\frac {x}{2}\right )\right )}{2 a}-\frac {x \left (\tan ^{5}\left (\frac {x}{2}\right )\right )}{2 a}}{\left (\tan ^{2}\left (\frac {x}{2}\right )+1\right )^{2} \left (\tan \left (\frac {x}{2}\right )+1\right )}\) | \(132\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 81 vs.
\(2 (23) = 46\).
time = 0.47, size = 81, normalized size = 3.00 \begin {gather*} \frac {\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {2 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - \frac {\sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} - 2}{a + \frac {2 \, a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac {a \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}}} - \frac {\arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.07, size = 18, normalized size = 0.67 \begin {gather*} \frac {\cos \left (x\right ) \sin \left (x\right ) - x - 2 \, \cos \left (x\right )}{2 \, a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\cos ^{2}{\left (x \right )}}{\csc {\left (x \right )} + 1}\, dx}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.41, size = 44, normalized size = 1.63 \begin {gather*} -\frac {x}{2 \, a} - \frac {\tan \left (\frac {1}{2} \, x\right )^{3} + 2 \, \tan \left (\frac {1}{2} \, x\right )^{2} - \tan \left (\frac {1}{2} \, x\right ) + 2}{{\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )}^{2} a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.24, size = 17, normalized size = 0.63 \begin {gather*} -\frac {\frac {x}{2}-\frac {\sin \left (2\,x\right )}{4}+\cos \left (x\right )}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________